<template>
	<view>
		<view class="page-foot" @click="formSubmit">
			<view class="g-btn1">修改</view>
		</view>
		<view class="container">
			<view class="ptb35 plr30 flex-box">
				<view class="fs30 col-3">单位名称</view>
				<input class="flex-1 tr fs30 col-3" v-model="ticket.company_name" type="text" placeholder="请填写" placeholder-class="col-9"/>
			</view>
			<view class="ptb35 plr30 flex-box">
				<view class="fs30 col-3">纳税人识别码</view>
				<input class="flex-1 tr fs30 col-3" v-model="ticket.tax_registration_number" type="text" placeholder="请填写" placeholder-class="col-9"/>
			</view>
			<view class="ptb35 plr30 flex-box">
				<view class="fs30 col-3">注册地址</view>
				<input class="flex-1 tr fs30 col-3" v-model="ticket.register_address" type="text" placeholder="请填写" placeholder-class="col-9"/>
			</view>
			<view class="ptb35 plr30 flex-box">
				<view class="fs30 col-3">注册电话</view>
				<input class="flex-1 tr fs30 col-3" v-model="ticket.register_mobile" type="text" placeholder="请填写" placeholder-class="col-9"/>
			</view>
			<view class="ptb35 plr30 flex-box">
				<view class="fs30 col-3">开户银行</view>
				<input class="flex-1 tr fs30 col-3" v-model="ticket.open_bank" type="text" placeholder="请填写" placeholder-class="col-9"/>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ticket:{
					company_name:'',
					tax_registration_number:'',
					register_address:'',
					register_mobile:'',
					open_bank:''
				},
			}
		},
		onLoad(){
			this.fetchTicket();
		},
		methods: {
			fetchTicket(){
				this.$core.get({url:'xiluedu.ticket/get_ticket',data:{},success:(ret)=>{
					if(ret.data){
						this.ticket = ret.data;
					}
				}});
			},
			formSubmit(){
				let ticket = this.ticket;
				this.$core.post({url:'xiluedu.ticket/add_ticket',data:ticket,success:(ret)=>{
					uni.showToast({
						title:ret.msg,
						icon:'none'
					})
				}});
			}
		}
	}
</script>

<style>

</style>
